/**
 * utilfun.c
 *
 * utilities function implementation.
 *
 * Copyright (c) sti-seedclass 2011, tankery.chen@gmail.com
 */
#include "LPC11xx.h"
#include "utilfun.h"
#include "timer.h"

#define SLEEP_TIMER 	TIMER32[0]
#define NORMAL_TIMER	TIMER32[1]

void utilInit(void)
{
	TimerInit(NORMAL_TIMER);
	TimerInit(SLEEP_TIMER);
}

void utilSleepMs(uint32_t mstime)
{
	TimerDelayMs(SLEEP_TIMER, mstime);
}

void utilDelayMs(uint32_t mstime)
{
	TimerDelayMs(NORMAL_TIMER, mstime);
}

void utilSleepUs(uint32_t ustime)
{
	TimerDelayUs(SLEEP_TIMER, ustime);
}

void utilDelayUs(uint32_t ustime)
{
	TimerDelayUs(NORMAL_TIMER, ustime);
}
